Skip to content

Restricted-Arrays#29

Open
codeandmorecode wants to merge 1 commit intoAda-C14:masterfrom
codeandmorecode:master
Open

Restricted-Arrays#29
codeandmorecode wants to merge 1 commit intoAda-C14:masterfrom
codeandmorecode:master

Conversation

@codeandmorecode
Copy link

No description provided.

Copy link
Collaborator

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, you hit the learning goals here. Nice work.

Comment on lines +9 to 11
# Time complexity: O(n^1), where n is the number of elements in the array.
# Space complexity: O(1) since the additional storage needed does not change based on input array size
def length(array)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 You could just say O(n) instead of O(n^1)

Comment on lines +23 to 25
# Time complexity: O(n^1) , where n is the number of elements in the array.
# Space complexity: O(1)
def print_array(array)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +35 to 37
# Time complexity: O(n^2), where n is the number of elements in the array.
# Space complexity: O(1) since the additional storage needed does not depend on input array size
def search(array, length, value_to_find)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , why do you think the time complexity is O(n^2)?

Comment on lines +51 to 53
# Time complexity: O(n^2), where n is the number of elements in the array.
# Space complexity: O(1) since the additional storage needed does not depend on input array size
def find_largest(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , why do you think the time complexity is O(n^2)?

Comment on lines +68 to 70
# Time complexity: O(n^2), where n is the number of elements in the array.
# Space complexity: O(1) since the additional storage needed does not depend on input array size
def find_smallest(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , why do you think the time complexity is O(n^2)?

Comment on lines +83 to 85
# Time complexity: O(n^2) where n is the number of elements in the array.
# Space complexity: O(n^1)
def reverse(array, length)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , why do you think the time complexity is O(n^2)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants